added trajectory logging