added 'back' button, refactored event handlers, added documentation