Reworked anchor square algorithm to correct implementation (row-by-row).
Transcribed Gordon algorithm, needs tests.