updated with some new tests and new document formats