added functionality to read from S3