change \n to endl for better monitoring of progress during batch jobs