removed the use of rand method for the breaking condition