Implement sorting of todos