adds add_task method to List class