adds a limit to the size of the cubes array