Update README.md

updated code algorithm