added handout mode flag and comments