change ratio to prob, add asserts