Remember a ruby script is read from top to bottom. If you move lines 3-14 underneath line 20 then you can write: 

   puts "What line do you want to get on at #{subway.keys}"?
   start_line = gets.chomp
   puts "What station do you want to get on at #{subway[start_line].keys}"
   start_station = gets.chomp