added advanceToNext()