first solution for task1