Lib and Test

The library file and a simple working test