update doc, describe internals.