Added batch function