fixes unitialized value
adds a wrapper class

The wrapper class PSufSort is added to simplify the code.