changed sample function
yeah