Adding relational logic