Add corner detect codes.