"and matching diagonals to form a perfect square."

Ummm, unless you know some magic architecture geometry that they didn't teach us at engineering school, I think matching diagonals can confirm a Perfect Rectangle (and that your Corners are square), but not a perfect square? You'll only confirm a Square if your Diagonals also cross at perfect 90 Deg Angles.