More work on the library
Merging with Heidi's work. Refactoring.
Merged, Refactored