fixed to plogp returns 0 if p=0