Trying to make sort function work.