sample code for S3.