added compute Mass function has segmentation faul