added/modded code to reflect why sometimes not useful to use ifelse statements