Added functionality to Line and Train classes.