updated Readme. Code cleanup and minor bug fixes