added set index functionality