This looks like black magic to me.  Can you explain what this is doing?