fix to PrmtShrage algorithm - now it passes test