Added temporal averaging and a small part of KF