reachedEnd() properly implemented

previous implementation was insufficient