Implemented ch3task6 and ch3task7