fixed functions in exercise5