modify example to use print function, rather than print statement