Syntax error
Remove duplicated code
Remove some comments and unused variables