Change the implementation of MQDF to largely enhance its performance.