Working version for all samples