added some comments for undestand the meaning of some variables