This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
Kept it commented-out for later revisions, if needed.
Now the pieces connect in different heights, too, creating a true 3D maze.