removed sort function to work on RP