mdp: bug with children
merged mdp with boundary checks