added printing function