add more color to output; refactor matching function