Made number of partitions an optional argument