Let's put some comments explaining the logic here.