Fixed variable redundancy, formatting and imports.