modified for MR based parallel gen