added consecutive filtering