small changes to posterior.py