added switch and case