modify addMyBook function so new books are stored in the correct index of the array