added a parallel for into the blocking function