Remove anonymous function

One way to speed up Julia code is to avoid anonymous functions, which don't get type-specialized in the current version of Julia.