Starting squares generator code.