Repair bug and add explaination of code