added util.lua
made minor changes