implemented small compare