wrapped the example code into a function