add get_kth_node method