scalarcorr.c update