added ability to set height average and min