included istat check in trans_phot, error checks matom and more commenting in adiabatic_cooling function