Thanks for all the comments in the patch! That should make it much easier for the next person who looks at this code.