Remove commented out code, moved variable declarations to top. Removed unused variable.