Removed some of the error print statements and started to add comments