created calc2.lua - slightly changed version