algorithm residential s3