Your family and one of your best friends families has decided to go camping, but you forgot to bring a container for water, on your way to the campsite your friend sees a container in the ditch he stops and picks it up, it has a skull and crossbones on the outside of the container, it says poison on it, and has a little bit of poison left at the bottom of the container, so he turns it upside down and dumps the poisonous liquid out, then when you get to the campsite he goes over to an area that has pure filtered water and he fills the container up with water, would you and your family be willing to drink out of that container? Of course you wouldn't! because if the container is contaminated so is the water. God can never accept the righteousness that comes out of the human heart, no matter how good it looks outwardly. God sees that the container it came out of is defiled. No matter how many good works we try to offer to God it can never offset the aggravation of sin, the only thing that can offset the aggravation of sin is the death of Christ, at the cross justice was answered fully and God's holy and righteous demands satisfied. The third day Jesus rose from the dead and defeated death. God offers salvation to anyone that will come to him in repentance and faith.
Isaiah 64:6 " But we are all as an unclean thing, and all our righteousnesses are as filthy rags; and we all do fade as a leaf; and our iniquities, like the wind, have taken us away."
Romans 10:3-4 "For they being ignorant of God's righteousness, and going about to establish their own righteousness, have not submitted themselves unto the righteousness of God. For Christ is the end of the law for righteousness to every one that believeth."