Debugged sort by pranjal