Implement the functionality to add a new task.