use uint instead of ulong, in case longs are 8 bytes