minimizing duplication and fixing averages from duplicating