Translate algorithm