Merging in Morgan's work. Adding database script.