Passing all tests for Exercises 4 and 5