Implemented task 8