Reworking to Block-expansion algorithm. DOES NOT COMPILE