fix probability and add comments