solved exercise 4 from exception-handling