Now works as a standalone library.