Definition for logic