create function

created the function