changegreedy algorithm is working