Added a Count of items. And links to definitions.

  also some code clean up
code clean up