What is the version of the following sentence with correct punctuation?

If possible a boat shall avoid a boat that is capsized or has not regained control after capsizing is anchored or aground or is trying to help a person or vessel in danger
If possible, a boat shall avoid a boat that is capsized or has not regained control after capsizing, is anchored or aground, or is trying to help a person or vessel in danger.