added library and tests