replace unsigned int max with a constant