added internals chapter to doc