Adding batch functionality