implemented equals methos.