adding a printing function