Vastly improved speed for sep_M calculations. Not verified yet.