Many changes!

Removed TPASortByWeight, pp_Sort & pp_RSort support weighted sorting now
Got rid of some unused variables
..also some small fixes + tweaking