trying with a function