Task 16 - fixed some bugs