Making onreadychangestate store all assignments in an array