auto adjust heights and segments