trying new idea with nested mode switches