Added sort funtion to the todo list