Added missing greedy argument
Removed unused lines
Added Depth First Search in Lua