Made a method to enclose random exit generation