First revision of sphere masking script