Modified some example code