a better fix for the sign comparison warnings during compilation