moved stat printing into fn