Added conditional continue and break