implement hascode and equals