Male and female of all flesh went in as God had said and the ark was shut by the Lord

What is the correctly punctuated version of this sentence?
Male and female of all flesh went in, as God had said, and the ark was shut by the Lord.