Added task 4 code