Added methods from existing code to the library.