fixed error and removed print statements used for debugging