Scrubbed code, minor changes.