Ether send function remainder handling
The Ether send function depicted below implements logic to reimburse the sender if an extraneous amount is left in the contract after the disbursement.\\n```\\nfunction sendEth(address payable [] memory \\_to, uint256[] memory \\_value) public restrictedToOwner payable returns (bool \\_success) {\\n    // input validation\\n    require(\\_to.length == \\_value.length);\\n    require(\\_to.length <= 255);\\n\\n    // count values for refunding sender\\n    uint256 beforeValue = msg.value;\\n    uint256 afterValue = 0;\\n\\n    // loop through to addresses and send value\\n    for (uint8 i = 0; i < \\_to.length; i++) {\\n        afterValue = afterValue.add(\\_value[i]);\\n        assert(\\_to[i].send(\\_value[i]));\\n    }\\n\\n    // send back remaining value to sender\\n    uint256 remainingValue = beforeValue.sub(afterValue);\\n    if (remainingValue > 0) {\\n        assert(msg.sender.send(remainingValue));\\n    }\\n    return true;\\n}\\n```\\n\\nIt is also the only place where the `SafeMath` dependency is being used. More specifically to check there was no underflow in the arithmetic adding up the disbursed amounts.\\nHowever, since the individual sends would revert themselves should more Ether than what was available in the balance be specified these protection measures seem unnecessary.\\nNot only the above is true but the current codebase does not allow to take funds locked within the contract out in the off chance someone forced funds into this smart contract (e.g., by self-destructing some other smart contract containing funds into this one).
The easiest way to handle both retiring `SafeMath` and returning locked funds would be to phase out all the intra-function arithmetic and just transferring `address(this).balance` to `msg.sender` at the end of the disbursement. Since all the funds in there are meant to be from the caller of the function this serves the purpose of returning extraneous funds to him well and, adding to that, it allows for some front-running fun if someone “self-destructed” funds to this smart contract by mistake.
```\\nfunction sendEth(address payable [] memory \\_to, uint256[] memory \\_value) public restrictedToOwner payable returns (bool \\_success) {\\n    // input validation\\n    require(\\_to.length == \\_value.length);\\n    require(\\_to.length <= 255);\\n\\n    // count values for refunding sender\\n    uint256 beforeValue = msg.value;\\n    uint256 afterValue = 0;\\n\\n    // loop through to addresses and send value\\n    for (uint8 i = 0; i < \\_to.length; i++) {\\n        afterValue = afterValue.add(\\_value[i]);\\n        assert(\\_to[i].send(\\_value[i]));\\n    }\\n\\n    // send back remaining value to sender\\n    uint256 remainingValue = beforeValue.sub(afterValue);\\n    if (remainingValue > 0) {\\n        assert(msg.sender.send(remainingValue));\\n    }\\n    return true;\\n}\\n```\\n