Simplified library.py