code cleanup and add readme.md