added a parameter minPartitions which can be tuned for better performance