Added a bit of Dustin's work, mostly commented