updating bag to a class