homework 6 submission

Again, could crash if next() returns null.