cleaned up code and updated README.md