refactored the sorting three numbers to rubocop's will.