Enhanced implementation
Added Derivative algorithm in Lua