updated code to use the translate funcitonality