added documentation for match function