Change calculate compare func