modified select, findMin, findMax to return values too