finished lua interface