added comments, create_task, and error handler