adding code to do backwards sampling to check prob