Exercise9 modified