docs
Added additional fields for debugging
Refactor for python2/3 portability