sampling version
Trying to clean this up
improvements