Add a useful explanation for this mad-looking code