wrapping it in a function