fixed syntax errors, now still need to fix runtime erros and check that the data structure is correct