define function 1st version