updated script, added tree height method