finished with sampling code, next to processing samples