improving sample operation