Updated program for collecting results