added comments to the MWD code