worked on batch inference