work on trip detection