added uint8_t and int clamp