adding solution for task 2