Modified todo list using functions