example to use it as a library