How to dynamically auto-pair checkbox selections