calc with case statement