Now working in arbitrary dimensions