updated using case statements