clean up

tried to fix the multiprocessing on mac osx. At least got some code cleanup out of if.