Where did George Lucas get the idea for Star Wars?

I believe that George Lucas got the idea for Star Wars from watching Flash Gordon serials, and from his like of racing cars.