Added optimization to prob