cleaned up advanced filtering, added basic docs and test