Completed code for Todo list