created a function within our database