Update MainFile

added potential looping process