Fixed typos, greedy algorithm running correctly