code cleaned up and commented
Merge pull request #2 from ppatel890/newfeatures

code cleaned up and commented