Solved 3rd task