you never said why the search was illegal, or was it?

why were you stopped? How did they end up searching your car?