Added task 3 code