Copied over library for open source