adding the batch function to the object