program for defining a function