24 And it came to pass when Israel had made an end of slaying all the inhabitants of Ai in the field in the wilderness wherein they chased them and when they were all fallen on the edge of the sword until they were consumed that all the Israelites returned unto Ai and smote it with the edge of the sword

Please fix the punctuation.
24 And it came to pass, when Israel had made an end of slaying all the inhabitants of Ai in the field, in the wilderness wherein they chased them, and when they were all fallen on the edge of the sword, until they were consumed, that all the Israelites returned unto Ai, and smote it with the edge of the sword.