Solved 4th task from Section 1.1