JC: more index. fixed minor bug