another programming exercise, two flags alternating windows