Added function to create random squares.