much more flexible sizing logic