initial commit
code cleanup and comments