updated result generating script to fix averages