Implemented Ranking Prune Function