Can we document this block a little bit?
The variable names don't really speak for themselve. What does it actually do?