added code for googleDocs mode, noted some bugs