added better outline and fleshed out some parts in Document