add functions for parallel