Add bags, create tests and fix bugs