Added first type of heuristic control algorithm.
Added the rest four heuristic control methods.
Fixed some bugs.