partial implementation of switching filter (doesn't work yet)