use stdint.h instead of inttypes.h
improve the way random integers are generated