implement masks drawing (not tested)