solve first part of task 2