implemented countSelected/selectUpTo