AdaptiveMST working solution.