merged in James's changes