added addWordDiagonal1 and flip function