corrected alignment,missing braces and unused variables