Added p computation. Someone check my computation plz.