use this as a library