modified mex sources to use new way of getting scalars