fixed error case in exercise 3, removed useless match in exercise 4