Trying to cast double* to double const* to fix problem