valid code appears to output from sort but i'm getting overflow all over the place and there is still a problem with the transformation counter while trying to run nw