Store checkout status in book object instead of array
Code refactored