corrected bag and bag2.py