Solved 2nd task