Modified collect.

Collect can now take a string representing the name of the attribute to collect.