taken out ternary operators from complicated expression