merging in James' changes