some code formatting and the fix for issue #29