added height calculation