Added lib and tests