Next time, just don't say anything. If they were going to search you anyway, you might as well not say anything. Your lawyer could've gotten you off by arguing previous decisions on cases in similar circumstances. But if you admit it and consent search, well you screw yourself over. Police only take advantage of honesty.