Changed rprintf to Zak's new code