added translate function