revision of 2nd exercise