working on main loop for each match
merging the initial image work with initial match loop work