bug fixing: firstCarriage must return null when the train data structure
is empty.