I'll rewrite some comments, make them as clear as possible.