Added mode switch

@xliiv please review.
add comma please