wrote function example