general structure of library program