Added ternary operator for final result