Exericse 5.3.5 - fixed errors