# Beginner noob question - is this a valid implementation of safemath?

hello guys, I'm just playing with BEP20 tokens and found the code on github. I want my code to be secure but the original code is using uint (and not uint256) so I'm not sure if my edit is valid: I have added 3 lines to use safemath:

``````pragma solidity ^0.8.2;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol';

contract Token {
using SafeMath for uint256;
using SafeMath for uint;
uint public totalSupply = 123 * 10 ** 18;
string public name = "My Token";
string public symbol = "TKN";
uint public decimals = 18;

constructor() {
balances[msg.sender] = totalSupply;
}

function balanceOf(address owner) public returns(uint) {
return balances[owner];
}

function transfer(address to, uint value) public returns(bool) {
require(balanceOf(msg.sender) >= value, 'balance too low');
balances[to] += value;
balances[msg.sender] -= value;
emit Transfer(msg.sender, to, value);
return true;
}

require(balanceOf(from) >= value, 'balance too low');
require(allowance[from][msg.sender] >= value, 'allowance too low');
balances[to] += value;
balances[from] -= value;
emit Transfer(from, to, value);
return true;
}

function approve(address spender, uint value) public returns (bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
}
``````

I think `uint` is alias to `uint256`, but I when I use it, i prefer to make it more clear, I always use `uint256`.
And after `0.8.x` version of the Solidity, it has checked arithmetic, that means it will revert on overflows, underflows etc. Yeah, you can still use this library contract.