finished but not tested Document and Token class