adding threads debug utilities, now we can print trainOut into files