Implementing the createTask Method