Add comments that fix an error in ref.py(answer provided by the course TA)