made changes, added maintainer for git, renamed to mainthread, did some commenting and code changes.
Merge pull request #2 from ifly6/master

accept this pull request