Some extensions to functional.lua