HasNext() and Next() now work properly