finished full library, with tests