Fixed redundant variables and formatting issues.