wrote a helper function. horizontal, vertical, diagonalright works. diagonalleft not tested.