Added solution to task 1.