Improvements on fun.lua