trip calculation and output