library developed as program exercise