fixed some name shadowing and formatting issues