Solved substring diff problem