old code with mask array, partially done
Merge pull request #1 from yoid2000/compare

old code with mask array, partially done