added a bunch of comments
removed some un-needed code
added 'r' for frame-by-frame recording