created function/while loop verification

created the function and created a while loop to make sure the function
has a value.