implement height func