fixed function matching pattern;clean comment