added comments and cleaned up algo code
improved readability and documentation in db files
Merge pull request #100 from myclamm/staging

improved readability and documentation in db files