trail implementation (ugly and INCOMPLETE)