figured out parallelization algorithm