final version incorporating Thomas edits