Updating HTree code