changed id structure for document and some minor changes.