Refactored parallel compute into a helper_function