basic solution to task 3