Improved scripting. Fixed bug in lookAt function