finished all functions of ArrayBag - HW1