Updates from Andrew's codebase