Lots of optimizations
Reducing useless calls
Parallelize loop
Fixing copy in "return"