minimize to tray, refactoring, lots of bug fixes, comments