added new batch function