basic library model, still largely untested.