Does anyone know why a function declaration needs to be above any of its calls in a map/reduce script? Was scratching my head trying to figure out what was going wrong until I thought to try moving it up and suddenly it's working. Function declarations are always at the bottom in all my other scripts.