two-way communication with lua
unnecessary parameters
formatted the script a bit