Fix bug. Move calculate_speed method into train class