Added cursor
Rewrote lua parsing