modify parallel code (because divided zero problem)