heuristic is basically working, result can be optimized, performance is pretty good