fixed a few syntax errors
discovered after actually running the code!