Fix syntax errors, add comments