tweaked pr calculation. Did reasonable testing and it seems like it is working