resort working (no rotation yet)
removed debug code; must fix rotation