lab1/lab3 bug fix in iterator.hasnext