Add scatter_if algorithm