Finally, I get it right with converting int to short unsigned int