added findMin function in qfun3d and changed some indexes(from 'o' to 'j')