Changed a good deal of formatting - no critical changes
Added significant logging additions