Implement the majority of the library