book code with modifications