added the framework from the book