added ex 1.3
add case that all three symbols are equal