add lib and tests