Update library.py

Adding in the core structure of status mismatch for library.  Did a little clean up of the over all structure.