Author Ellie Palmer pulled a lot from her own experience while writing her debut rom-com , Four Weekends and a Funeral — but Sandra Bullock and Bill Pullman inadvertently led to the novel’s twist. Light spoilers for Four Weekends and a Funeral ahead. “The movie While You Were Sleeping was a huge inspiration for me,” Palmer exclusively told Us Weekly while promoting the novel, which was released on Tuesday, August 6.

The 1995 classic stars Bullock as Lucy, a woman who is misidentified as the fiancée of a comatose patient named Peter ( Peter Gallagher ) after accompanying him to the hospital. There, she meets Peter’s brother, Jack (Pullman) and they fall in love. “One of the best parts of that movie for me is when Peter Gallagher wakes up — it just sort of takes everything in a different direction,” Palmer explained to Us .

“Because he wakes up, he can kind of give them permission to be together at the end. He gets to give them the OK, and it gives you this warm feeling at the end.” This wasn’t an option for Palmer when it came to her book.

Four Weekends and a Funeral follows Alison — a 30-year-old woman who recently underwent a double mastectomy after testing positive for the BRCA-1 gene mutation — as she attends her ex-boyfriend Sam’s funeral. Alison discovers that Sam’s family never found out about their breakup, leading his parents to believe that they were still romantically involved when he died. Sam’s best friend, Adam, throws a wrench i.