implemented assign value to array index