Algorithms implemented in Lua