findNde method corrected, in tests file raise IndexError is caught