replaced INT32_MAX with limits.h