uint to int because nmatrix doesnt support it