Ok so to start I have swapped the motor in my 03 z4 2.5. The same type of motor was swapped in (m54b25). Everything seemed good as I went to start it the first time it fired up pretty quickly. I then turned it off to button everything up, (connect exhaust, insure torque specs were good, inside everything was connected). Then it was finished everything was good to go and as I go to start it again, the engine would only crank. I have self assumed it is a electrical issue but cannot figure out the source, I assume this because when I turn the key to the on position the car seems to power on and off rhythmically (basic dash lights come on and off, you can hear the fuel pump come on and off, radio comes on and off). It does the on off thing 4-6 times then it stays on as if nothing is wrong. I go to fire the car up though and it only cranks. I’ve checked everything I can thing of, fuel pump works lines are good the injectors are getting fuel, all spark plugs are good and coil packs, timing check, compression check, air check, all the plugs are in the right area, ground strap is on, I even changed out some fuses and I’m stumped