Limit squaring to near square or near straight nodes
Remove unused variables