Almost works; just need to fix the endOfText character counting to actually count the correct array.