added lib and tests