Adding basic logic