Dm 1.2.0

Hi, I've cleaned up a lot of the code and tested against dm 1.2.0

Do pull if everything is ok.