First re-write of MLmask