implement matches()