Ann: First implementation of findConnections using helper checkDirection.