Fixed and improved greedy heuristic