First fully working, clean and commented version of DPM SPARSE DETECT. More to follow.