Changed trans function