Add missing code

Cut and paste rest of document into git.