Significant changes to the way state is handled and tracked. Fixed bug where index would go out of bounds if book was changed.