trips logic