switched to cloudcode method for fetching pairs of data