Solution for task7