Useing a timing light, follow Nissan's timing instructions as JM has perfectly described for you. Tighten your distributor down, recheck and don't move it again.
If moisture collects in the sparkplug tubes you will get a miss-fire rough idle and under load. You may need new sparkplugs. Inspect the plug wires for corrosion and moisture. Inspect the hose between the MAFS and the throttle body for proper installation and secure clamps.
Very likely you will find the problem is a vacuum leak between the intake manifold and cylinder head around the #4 intake runner which is very common.