properly implemented align and tokenize