added concurrent version of the function