TP3: Finished Almost Greedy Algorithm