finish nahao function