The mitigating effect of masks on the spread of Covid-19