fixed syntax errors, first working version