cleaned up the code, added fragments to ui for event processing, still need to work on the ui, back-end works well though