Forgot to switch square_z to reference coordinate system before using it.  In my case reference and actual where so close I didn't catch it.