ex17: more comments & improvements