filter still ugly, but working for all types and comparisons now