-- limited to safe lua functions
env = {
  next = next,
  pairs = pairs,
  ipairs = ipairs,
  pcall = pcall,
  print = tada,
  rawequal = nada,
  rawget = nada,
  rawset = nada,
  select = select,
  setfenv = nada,
  setmetatable = nada,
  tonumber = tonumber,
  tostring = tostring,
  type = type,
  unpack = unpack,
  _VERSION = _VERSION,
  xpcall = xpcall,
  coroutine = {
    create = coroutine.create,
    resume = coroutine.resume,
    running = coroutine.running,
    status = coroutine.status,
    wrap = coroutine.wrap,
    yield = nada
  },
  module = nada,
  require = nada,
  string = {
    byte = string.byte,
    char = string.char,
    dump = nada,
    find = string.find,
    format = string.format,
    gmatch = string.gmatch,
    gsub = string.gsub,
    len = string.len,
    lower = string.lower,
    match = string.match,
    rep = string.rep,
    reverse = string.reverse,
    sub = string.sub,
    upper = string.upper,
    join = tada,
    replace = tada,
    split = tada,
    trim = tada
  },
  table = {
    insert = table.insert,
    maxn = table.maxn,
    remove = table.remove,
    sort = table.sort,
    wipe = tada
  },
  math = {
    abs = math.abs,
    acos = math.acos,
    asin = math.asin,
    atan = math.atan,
    atan2 = math.atan2,
    ceil = math.ceil,
    cos = math.cos,
    cosh = math.cosh,
    deg = math.deg,
    exp = math.exp,
    floor = math.floor,
    fmod = math.fmod,
    frexp = math.frexp,
    huge = math.huge,
    ldexp = math.ldexp,
    log = math.log,
    log10 = math.log10,
    max = math.max,
    min = math.min,
    modf = math.modf,
    pi = math.pi,
    pow = math.pow,
    rad = math.rad,
    random = math.random,
    randomseed = math.random,
    sin = math.sin,
    sinh = math.sinh,
    sqrt = math.sqrt,
    tan = math.tan,
    tanh = math.tanh,
  },
  -- wow shorthand aliases
  date = os.date,
  time = os.time,
  difftime = os.difftime,
  abs = math.abs,
  acos = function (x) return math.deg(math.acos(x)) end,
  asin = function (x) return math.deg(math.asin(x)) end,
  atan = function (x) return math.deg(math.atan(x)) end,
  atan2 = function (x,y) return math.deg(math.atan2(x,y)) end,
  ceil = math.ceil,
  cos = function (x) return math.cos(math.rad(x)) end,
  deg = math.deg,
  exp = math.exp,
  floor = math.floor,
  frexp = math.frexp,
  ldexp = math.ldexp,
  log = math.log,
  log10 = math.log10,
  max = math.max,
  min = math.min,
  mod = math.fmod,
  PI = math.pi,
  rad = math.rad,
  random = math.random,
  randomseed = math.randomseed,
  sin = function (x) return math.sin(math.rad(x)) end,
  sqrt = math.sqrt,
  tan = function (x) return math.tan(math.rad(x)) end,
  format = string.format,
  gmatch = string.gmatch,
  gsub = string.gsub,
  strbyte = string.byte,
  strchar = string.char,
  strfind = string.find,
  strlen = string.len,
  strlower = string.lower,
  strmatch = string.match,
  strrep = string.rep,
  strrev = string.reverse,
  strsub = string.sub,
  strupper = string.upper,
  foreach = table.foreach,
  foreachi = table.foreachi,
  getn = table.getn,
  sort = table.sort,
  tinsert = table.insert,
  tremove = table.remove,
  -- wow helpers
  strtrim = tada,
  strsplit = tada,
  strjoin = tada,
  strconcat = tada,
  strreplace = tada,
  getglobal = tada,
  setglobal = tada,
  debugstack = tada,
  scrub = tada,
  tostringall = tada,
  wipe = tada
}