updated code to do height of tree computation.