trail generation