added Train class with associated tests