added lua and cleanup