now using uint instead of int