fixed bug in CDF for inverse sampling for Rs!=0
fixed bug in potential