optimized the get_average method; still needs a lot of work
Merge pull request #17 from kelmerp/speedup_get_average

optimized the get_average method; still needs a lot of work