modify printing function