working averages - awful implementation