Make p calculation not crash due to overflow error. (Use longs instead. Wait for it\!)