fixed bugs related to exercise 5