basic node and trail logic