copy the shrink trick from previous author