s3 working even better, trimmed the code down a bit