Add forwardtrace algorithm