added train tracker logic