added matching functionality