fixed compiler warning in func_kal (X has to be const double[])