cleaning, refactoring, and removing syntax errors