Added trail logic