correction of mistakes

other implementation of bagIterator, some shanges in methods of Bag
class and BagTest