Incorporate James' code to resolve merge conflicts.