improved rama_pmf in rama.py