improved heuristics.

TODO: load
TODO: pass parameters in a better way
TODO: major refactor