Trying to optimize batch run