using time stamp to decide turning points