make height checking smarter