first version of faster heuristic