now checks for vertical, horizontal, diagonal and antidiagonal connections