improved documentation and test script