better code for tile tokenization