Pretty sure pivoting works correctly now. I implemented a check to see if a square is connected to the master as part of that. Working on different ways of random square generation for more interesting shapes.