JC: minor changes. Added index to tables.