using percentage to calculate maxheight