Adding get index functionality