an interesting substring matching algorithm added