Added a parameter to change the pattern subdivisions