Added height detection