packed versions of John's JS code from dataset collections