minor bug fixes
restructuring source code
gui sharing working