Added S3 code