This will be a double blind, placebo-controlled study of patients ≥65 years of age undergoing surgery of the spine, hips and knees replacement at the University of California, San Francisco (UCSF) Medical Center. Intraoperative anesthetic and postoperative pain management will be standardized. Patients will be randomized to receive either placebo or gabapentin preoperatively, and continued postoperatively until discharge. Intraoperative anesthetic and other postoperative pain management strategies will be standardized. Postoperative delirium will be measured using structured interviews. Cognitive function will be measured using a battery of neurocognitive tests pre- and post-operatively. Using an intention to treat strategy, we, the researchers at UCSF, will compare the amount of postoperative pain, narcotic requirements, and postoperative delirium and cognitive dysfunction between the two groups.