2014/1/27 TODO: python version greedy algorithm