Added comments on slightly obscure code