We are moving into more sort of advanced stuff here, so I think this method could use both a short docstring and inline comments for almost every line. It may just be that I'm slow :) but it took me some time to read.