exercise #2 modified