Add lib and unit test