finally working, damn unsigned char