Implementing sort() method on numbers