working version of book example translateExpression