updated sample loader