Changed whole code structure...

...also add some kind of  pre-bonus function