added task1, task2, task5 from homework4