using unsigned short int for memory improvements