write a function test