use uint32_t rather than long