Cleaned up tokenize code and doc