init with code and a book