Added dimension-at-a-time sampling capability. It's pretty slow.