Problem 12 and batch.cpp