Final version with bits of V8JS implementation.