Added example code and comments