result function definition