Solving possibility of division by zero for PWall == 0 by if-statement