Use diff(double(str)).
Update comments for compare().