finished average filter, needs testing