moved functions to top level of module to fix Pool.map