Removed unused local variables; minor formatting changes.