removed requirement that masks be of same dim