Rewrite nondiagonal side stepping code.