adds print statements for debugging and fixes syntax errors