use match for main