added reef doc, tests, and checked code style