Changed unsigned char to int on line 19