Switched from if/else statement to ternary statement.