rewriting the library without dependencies.