sampling fix and cleanup

sampling fix