generatePartitions function was added