fix to greedy, added improve