Experimenting with co-routines: added 'hasNext'.