Changed sum to gSum to allow these apps to run in parallel.