- use unsigned instead of int where appropriate