changed parameter to number of matches desired. Added plotting for .png.