preliminary work on add_task function