Improved matching and added some randomness to add variety