starting to fix errors in the code