adding mdp function