Edit distance algorithm to find sequence similarities