add comments
fix variable redeclaration