Modified for James's setup