Slightly modified foote algorithm for Trains - Porcupine Tree Demo