added exercise e and f