Cleaned up some code, added some comments. Added a README.md file.