refactor code, add readme.md