Revision 9

Added UI and some event handlers.