Yes, in knowledge he certainly was. But even that knowledge couldn't make him righteous. That was him in his old life under the law in Romans 7. But that was before Christ. If you believe trying to obey the law is enough, it isn't. You must be born again of the Spirit of God.