added some documentation and reorganized some code
added readme
reorganized code and added some comments