added lang parameter to functions