added 'break' function
added break function to drive logic in main