added a test for p=0 before taking log for entropy calc