cleaned up sampling