added debug code and make functionality, updating filter functions