Commenting and formatting fixes
Add error level info