implemented each statement from example and will implement my own iterator pattern next