Refactored to include array for storing book titles