modify equals function