[Ref] Reimplementattion in processing js