added id -> annotation map for document;
added javadocs