changed from unsigned char to char