Added ternary operator when computing statistics