minor formatting and use of local for variable setting.