Exercise3 modified