code formatting and other minor adjustments