select function based on program name.