Alternator started sparking

I checked the brushes and they were fine, cracked open the alternator and everything looked “normal”, checked my wiring and everything was “fine”... except my grounds. I took all grounds off and my main ground on my block was over paint and my starter relay was loose on the fender. I cleaned all the paint off the engine at the connection and put in some bolts and nuts to secure the relay. It starts like a champ now and my alternator is working without sparks. Thank you guys for all the help! I’ve learned so much from this site!