another fix for reporting code and added comments