Implemented a bag data structure