fixed bugs and reshaped the algo for finding top ps files