added code to compute the MF