Complex filtering fix. Still incorrect results though