Added primary index functionality