Updated.
Refactoring code and fixed bag.