use if expressions instead of conditional operators