worked out s3 storage core function