Added some code for function matching.