added bag data structure