case statement implemented