Fast Expected string Machine using an n-gram Algorithm