added linear filter function