proper use of equal function