fixed some bugs, bug found in greedy algorithm needs fixation, table in tex file