added an oldMatrix that saves the matrix before, incase the next word starts with same letters