cleaned up and added test to bag