added some documentation and diagnostic data.