updated to calculate and set parent dimensions