moved helperfunctions and util to util.lua