added composite and iterator implementations from homework 7 and 8