My take on the law is that it was provided to force man into examining his own soul and conscience. By looking at his own failures, in the light of the divine standard, man comes to realize both his own hopelessness and the need for God's forgivness. Where the heart seeks purity and conformance, not just to the letter of "the law" but to the spirit of the law, then the law itself becomes unnecessary. It does man no good to avoid stealing if, in his core, he still coveats or lusts after someone else's good. Likewise the act of adultary is already complete when a man allows attraction to turn into lust and fantasy about a woman, not his wife.
Only the inhabitation of the spirit of God can begin the reprogramming of our minds and soul