first function version
first version of a function
second attempt