pseudocode demonstrating collector behavior