Fixing bug with exercise 6 and exercise 9