Added comments; stubbed in support for demo mode.