first switch implementation