make cast explicit in heightFunction