add some explanations about the code