q* utils, courtesy of Chase