added some documentation, tests
formatting