working function to translate but needs testing