Filmmakers have long used focus groups and test audiences to determine how to best tweak their vision for maximum crowd appeal. It makes good business sense, and can increase the likelihood that you enjoy a film in the long run. Now, the science of getting moviegoers out of their homes and into theaters just got kicked into overdrive thanks to a new study that shows how neuroscience and brain scanning can actually forecast whether a movie will be a hit or a bust.

Researchers at Northwestern’s Kellogg School of Management have developed a method for predicting how well a movie trailer will be received by audiences, and thereby accurately predicting how well the film itself will perform in theaters.

In a study of over 120 movie buffs, participants wore EEG brain monitors while watching a variety of film trailers and their brain wave patterns were monitored. The researchers were able to determine how well the trailers were grabbing the attention of the viewers based on how similar the viewers’ brain patterns were. That “neural similarity” rating tended to be a great predictor of how well the final product was received at the box office, with greater neural similarity resulting in a higher gross and more engagement.

With over a dozen film trailers in the test pool, the clip for X-Men: Days of Future Past performed the best, and the animated film Mr. Peabody and Sherman came in last place. Those neural similarity ratings accurately matched with the box office performance of both movies, and the team says that its brain wave scanning method is at least 20 percent more accurate at predicting a film to be a flop or a hit than less scientific survey options.