Clean up and document code
Update README.md