add get leftmost leaf function