Updating read value to take a pointer to ints, so that the values can be read by the calling function