wrap it into a function