invert selection implementation