fix errors and adding more print statements