added newheight formula