Tried to solve Task 4, but not quite there yet