updates to computeWidth and computeHeight functions