improved documentation, couple more tests, minor aesthetic changes