implement break to reduce the amount of looping.