added prob def to first loop