351 timing

Changed out thermostat in the boat yesterday, went inside for a drink, came back out and my son had the spark plug wires off the distributor cap. I put them back on to what I thought was right but when I got on the water today the boat was sputtering and stalling. I switched two wires and it will plane out and run now but there's a ton of vibration when the motor is idling .. At time when I put it in gear it wants to stall. When I gas it and get it really going it seems to smooth out. At times it will start right up but others it turns over a few times or I have to give it gas to start. I started to think maybe bad fuel it carb issues....

So I'm not sure I have the wires hooked back up right. Before it never ran like this. I need to figure out the wiring issue first and then set the timing. I've looked at pics with the firing order an wiring rotation but its not helping. Do you guys have a good procedure I could follow to get this right????? Thanks