add shift method to trie