Add comments, code cleanup
copyright & licence, first pass
clean up