added 3 elements and separate functions.lua