Implemented task 2