Added calculation for probability
Added generator method