deals with multifit arguments better, should even work with mask (untested, inefficient)
Automatic style corrections courtesy of autopep8