compute widths/heights