add filter and lots of debug statements.