improoved pas.lua