Tidied the squareBlocks function up