updated filter code for me84 with the averaging function implemented