still debugging QP mex