code done for Task 1