Task 4 implemented