fix bug with your selection, and remove some ugly code