modify next() method and add unit tests - still failing though :-(