batchSizes is getting modified in this class - ensure this class works with a copy of it