Sped up the selection/deselection functions.