script for distributed lists in chat

more room for improvement, but the basics should be there.
extra space at end of method