Merge pull request #61 from lindahua/improved_logpdf

Improved logpdf