Added buffer for noise filtering