reduce using broadcast variables