The pilot episode of the television series Veronica Mars premiered on UPN on September 22, 2004. It was written by series creator Rob Thomas, and directed by Mark Piznarski. Set in the fictional town of Neptune, the pilot introduces Kristen Bell as the title character, a high-school student moonlighting as a private investigator under the wing of her detective father. Two separate mysteries are presented in the episode, which are explored throughout the season and resolved in the final and penultimate episodes. Thomas originally wrote Veronica Mars as a young adult novel, featuring a male as the protagonist. He changed the gender of the protagonist because he thought a noir piece told from a female point of view would be more interesting and unique. The original pilot script was darker in tone than the one filmed, and several details were changed. Although it ranked low in the ratings, the pilot was critically acclaimed and Bell's performance as the protagonist was praised. Plot Flashbacks reveal Veronica's backstory: in small-town Neptune, California, Veronica – daughter of well-respected County Sheriff Keith Mars (Enrico Colantoni) is a typical teen who was dating Duncan Kane (Teddy Dunn), and was popular with loving parents. But when her best friend and Duncan's sister, Lilly Kane (Amanda Seyfried), is murdered, Veronica's life falls apart. Keith accuses software billionaire Jake Kane (Kyle Secor), Lilly's father, of being involved in the murder. This provokes Neptune's wrath, and Keith is ousted from office and replaced by Don Lamb (Michael Muhney) in a recall election. Veronica's mother, Lianne Mars (Corinne Bohrer), unable to face the loss of status and economic security, develops a drinking problem and suddenly leaves town. Veronica's boyfriend also ends their relationship, and her friends turn their backs on her. To prove that she is unaffected by the rejection, Veronica attends wealthy classmate Shelly Pomroy's "09er" party. Her drink is spiked with GHB and she is raped, but Sheriff Lamb refuses to take her report seriously. These events shock Veronica and she changes her attitude towards her former friends, becoming tough and cynical. Estranged from all her "09er" friends—wealthy students from the fictional 90909 ZIP code—including Duncan and Lilly's ex-boyfriend, Logan Echolls (Jason Dohring), and feeling the drop in income and status that her father's dismissal from office brings, Veronica takes a part-time job in her father's newly opened private investigation agency, Mars Investigations. Although the case of Lilly's