updated to use comparable and sorts