using cases instead of condtionals