Added my solution to task 6.