Add logic to ensure we don't attempt to go past end of book