made some unsigned int changes so it compiles clean with -Wextra