calculate missing dimensions.