created a function