USB Serial on Leonardo is affecting a sketch

Do not know what I did but I got the thing to finally work as standalone (no PC connected)

it was tweaking this and that with the help on here and another forum that fixed it
but I learned a thing or two as well.
Now to apply this to a version that I coded for Windows with .NET in C#.

now if could fix SerialPort class in .NET I would be happy.

Not sure how to mark this solved.