added incoming and outgoing token constraints
added filter() to TokenConstraint