Accounting for more things in the width/height algorithms