Splitted code into several files, also added removing values form bag.